import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';

import { resolve } from 'path';

// https://vitejs.dev/config/
export default defineConfig({
    plugins: [vue()],
    resolve: {
        alias: {
            '@': resolve(__dirname, './src'),
        },
    },
    server: {
        port: 8080,
        host: true,
        open: false,
        proxy: {
            '/dev': {
                // target: 'http://192.168.166.136:45678',
                target: 'https://www.russia.lxypt.net',
                changeOrigin: true,
                rewrite: p => p.replace(/^\/dev/, ''),
            },
            // '/prod': {
            //     target: 'https://www.russia.lxypt.net',
            //     changeOrigin: true,
            //     rewrite: p => p.replace(/^\/prod/, ''),
            // },
        },
    },
    build: {
        minify: 'terser',
        terserOptions: {
            compress: {
                drop_console: true,
                drop_debugger: true,
            },
        },
    },
});
